import java.util.Scanner;

// (int)Math.ceil(a) 对浮点数向上取整
public class Main1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        double a = scanner.nextDouble();
        char b = scanner.next().charAt(0);
        int ret = 0;
        if (a <= 1.0) {
            ret = 20;
        } else {
            ret = 20 + (int)Math.ceil(a - 1.0); // 向上取整
        }
        if (b == 'y') ret += 5;
        System.out.println(ret);
    }
}
